import {Component, OnInit} from '@angular/core';
import {PriceQuote} from '../price-quote/price-quote.component';

@Component({
  selector: 'app-order',
  templateUrl: './order.component.html',
  styleUrls: ['./order.component.css']
})
export class OrderComponent implements OnInit {

  stock: string;

  priceQuote: PriceQuote = new PriceQuote('IBM', 0);

  constructor() {
  }

  ngOnInit() {
  }

  /*捕获发射事件 event就是子组件中发射出来的对象数据*/
  receiveData(event: PriceQuote) {
    this.priceQuote = event;
  }

  buyHandler(event: PriceQuote) {
    this.priceQuote = event;
  }
}
